package acwing;

import java.io.*;
import java.util.*;

public class ac3625 {
    static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
    static BufferedReader bin = new BufferedReader(new InputStreamReader(System.in));
    static final int MOD = 233333;
    static long a, k;

    static int cin() throws IOException {
        in.nextToken();
        return (int) in.nval;
    }

    static long qmi(long a, long k) {
        long res = 1;
        while ( k > 0 ) {
            if ((k & 1) == 1) {
                res = res * a % MOD;
            }
            k >>= 1;
            a = a * a % MOD;
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        a = cin(); k = cin();
//        long res = qmi(a, k);
        out.println(qmi(a, k));
        out.close();
    }
}
